﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WorkerService.Common
{
    public class Utility
    {
        /// <summary>
        /// 是否到时间进行执行
        /// </summary>
        /// <param name="times">到点运行时间（小时）14|20|01</param>
        /// <returns>true：时间已到；false：时间未到；</returns>
        public static bool TimeOut(string times)
        {
            if (times == null || times.Trim().Length <= 0)
            {
                return false;
            }            
            return times.Split('|').Cast<string>().Any(a => a.Trim().Equals(DateTime.Now.ToString("HH")));
        }
    }
}
